<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>H+ 后台主题UI框架 - 登录</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="favicon.ico"> <link href="__STATIC__/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <link href="__STATIC__/admin/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <!--<script src="__STATIC__/layer/css/layer.css"></script>-->
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
</head>

<body class="gray-bg">

    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <div>

                <h1 class="logo-name">H+</h1>

            </div>
            <h3>欢迎使用 H+</h3>

            <form class="m-t" role="form" action="" method="post"  id="loginForm">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="用户名"  name="account" id="account">
                </div>
                <div class="form-group">
                    <input type="password" class="form-control" placeholder="密码"  name="passwd" id="passwd">
                </div>
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="验证码" maxlength="5" name="verifyCode" class="login_txtbx" id="verify_code">
                </div>
                <div class="form-group">
                    <img src="/admin/Login/captchaImg" alt="captcha" class="yzm"  title="换一张" width="170" height="42" style="float:right; display:block; cursor:pointer;" />
                </div>
                <button type="submit" class="btn btn-primary block full-width m-b submit_btn">登 录</button>


                <p class="text-muted text-center">© 2017-2018 了解科技 版权所有
                </p>

            </form>
        </div>
    </div>

    <!-- 全局js -->
    <script src="__STATIC__/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/admin/js/bootstrap.min.js?v=3.3.6"></script>

    <script src="__STATIC__/admin/js/plugins/layer/layer.min.js"></script>
    <script>
        $(document).ready(function() {

            $(".submit_btn").click(function(){

                if($("#account").val()==""){
                    layer.alert("账号不能为空!");
                    return false;
                }

                if($("#passwd").val()==""){
                    layer.alert("密码不能为空!");
                    return false;
                }

                if($("#verify_code").val()==""){
                    layer.alert("验证码不能为空!");
                    return false;
                }


            });

            $(".yzm").click(function(){
                if( $(this).attr("src").indexOf('?')>0){
                    $(this).attr("src", $(this).attr("src")+'&random='+Math.random());
                }else{
                    $(this).attr("src", $(this).attr("src").replace(/\?.*$/,'')+'?'+Math.random());
                }
            });
            $('form').submit(function (event) {
                var account = $("input[name='account']").val();
                var passwd = $("input[name='passwd']").val();
                var verifyCode = $("input[name='verifyCode']").val();

                $.post("{:url('Login/login_do')}",{account:account,passwd:passwd,verifyCode:verifyCode},function(result){
                    if(result.code == '0'){
                        layer.alert(result.msg);
                    }else{
                        layer.alert(result.msg, {
                                    btn: ['确定']
                                },
                                function (index, item) {
                                    location.href = result.url;
                                });
                    }
                });

                return false;
            });
        });

    </script>


</body>

</html>
